parameters:
  displayName: ''
  condition: true
  archType: ''
  osGroup: ''
  osSubgroup: ''
  buildConfig: ''
  creator: ''
  publishTestResults: ''
  helixAccessToken: ''
  helixBuild: ''
  helixSource: ''
  helixQueues: ''
  helixType: ''
  msbuildParallelism: '/maxcpucount'
  scenarios: ''
  timeoutPerTestCollectionInMinutes: ''
  timeoutPerTestInMinutes: ''
  runCrossGen2: ''
  compositeBuildMode: false
  helixProjectArguments: ''
  runInUnloadableContext: ''
  tieringTest: ''
  hotColdSplitting: ''
  nativeAotTest: ''
  longRunningGcTests: ''
  gcSimulatorTests: ''
  runtimeFlavor: 'CoreCLR'
  runtimeVariant: ''
  shouldContinueOnError: false
  SuperPmiCollect: ''
  SuperPmiDiffType: ''
  SuperPmiBaseJitOptions: ''
  SuperPmiDiffJitOptions: ''


steps:
- template: send-to-helix-inner-step.yml
  parameters:
    osGroup: ${{ parameters.osGroup }}
    sendParams: ${{ parameters.helixProjectArguments }} ${{ parameters.msbuildParallelism }} /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog /p:TargetArchitecture=${{ parameters.archType }} /p:TargetOS=${{ parameters.osGroup }} /p:TargetOSSubgroup=${{ parameters.osSubgroup }} /p:Configuration=${{ parameters.buildConfig }}
    condition: and(succeeded(), ${{ parameters.condition }})
    shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
    displayName: ${{ parameters.displayName }}
    environment:
      _Creator: ${{ parameters.creator }}
      _PublishTestResults: ${{ parameters.publishTestResults }}
      _HelixAccessToken: ${{ parameters.helixAccessToken }}
      _HelixBuild: ${{ parameters.helixBuild }}
      _HelixSource: ${{ parameters.helixSource }}
      _HelixTargetQueues: ${{ join(',', parameters.helixQueues) }}
      _HelixType: ${{ parameters.helixType }}
      _RunCrossGen2: ${{ parameters.runCrossGen2 }}
      _CompositeBuildMode: ${{ parameters.compositeBuildMode }}
      _RunInUnloadableContext: ${{ parameters.runInUnloadableContext }}
      _TieringTest: ${{ parameters.tieringTest }}
      _HotColdSplitting: ${{ parameters.hotColdSplitting }}
      _NativeAotTest: ${{ parameters.nativeAotTest }}
      _LongRunningGcTests: ${{ parameters.longRunningGcTests }}
      _GcSimulatorTests: ${{ parameters.gcSimulatorTests }}
      _Scenarios: ${{ join(',', parameters.scenarios) }}
      _TimeoutPerTestCollectionInMinutes: ${{ parameters.timeoutPerTestCollectionInMinutes }}
      _TimeoutPerTestInMinutes: ${{ parameters.timeoutPerTestInMinutes }}
      RuntimeFlavor: ${{ parameters.runtimeFlavor }}
      _RuntimeVariant: ${{ parameters.runtimeVariant }}
      _SuperPmiCollect: ${{ parameters.SuperPmiCollect }}
      _SuperPmiDiffType: ${{ parameters.SuperPmiDiffType }}
      _SuperPmiBaseJitOptions: ${{ parameters.SuperPmiBaseJitOptions }}
      _SuperPmiDiffJitOptions: ${{ parameters.SuperPmiDiffJitOptions }}
      ${{ if eq(parameters.publishTestResults, 'true') }}:
        SYSTEM_ACCESSTOKEN: $(System.AccessToken)
      # TODO: remove NUGET_PACKAGES once https://github.com/dotnet/arcade/issues/1578 is fixed
      NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages
